'''
requests.post()
1.传form-data

2.传x-www-form-urlencoded

3.传json
'''
import requests

if __name__ == '__main__':
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
    }
    response = requests.post(url='https://fanyi.baidu.com/ait/text/translate', json={
        "query": "英语",
        "from": "zh",
        "to": "en",
        "reference": "",
        "corpusIds": [],
        "needPhonetic": False,
        "domain": "common",
        "milliTimestamp": 1726413627261
    }, headers=headers)

    print(response.text)
